#include <sys/kernel.h>
#include <debug.h>
#include <cpu.h>

/*
 * Singleton stuff
 */
Kernel* Kernel::instance;

Kernel* Kernel::getInstance() {
	return instance;
}

/*
 * Object stuff
 */
Kernel::~Kernel() { } 

Kernel::Kernel() {
	isStarted = false;
}

void Kernel::start() {
	if ( isStarted ) 
		return;	// kernel is already started
	else
		isStarted = true;
	// set gdt
	// set idt
	
	kprintf(KMSG_BANNER);
	kprintf("\n");
	kprintf(KVERSION);
	kprintf("\n");
	
	//init proccess manager
	//init message dealers
	//init virtual memory manager

}

void Kernel::panic() {
	kprintf("\nKernel panic, get out here, it's gonna blow.\n");
	clearInterruptFlags();
//	while(true) { } // infinite loop
}

void Kernel::shutdown() {
	halt();
}
